package com.algo.core.filter;

import com.algo.core.RequestContext;
import org.apache.log4j.Logger;

/**
 * 权限拦截过滤器，这个接口主要做什么事情呢？
 *
 * 针对需要访问权限的路径，在这里进行权限的认证
 *
 */
public class AuthorityFilter implements RapidFilter {

    private static final Logger logger = Logger.getLogger(AuthorityFilter.class);

    @Override
    public void doFilter(RequestContext requestContext, RapidFilterChain chain) {
        logger.info("authority filter is executing");
        chain.doFilter(requestContext, this);
    }

    @Override
    public int getOrder() {
        return FilterOrder.AUTHORITY_FILTER.order;
    }
}
